<extend name='Public/_Main' />
<block name='right'>
    <div class='node_delete'>
        <!--权限结构-->
        <foreach name='list.role' item='role'>
            <div class="panel panel-default level-1 auth_parent ">
                <div class="panel-heading">
                    <h3 class="panel-title panelh3">
                 <input type="text" id="{$role.id}" name="ord" class="node_sort form-control pull-left" value="{$role.ord}">
                    <label level="1">
                   <input type='text' class="badge">
                       {$role.title}
                        <span class='auth_color'>[{$role.name}]</span>
                    </label>
                    <span class="label label-danger pull-right" id='{$role.id}'>删除</span>
            </h3>
                </div>
                <div class="panel-body">
                    <!--leve2-->
                    <foreach name='role.child' item='child'>
                        <div class="panel panel-success level-2">
                            <div class="panel-heading">
                                <h3 class="panel-title panelh3">
                             <input type="text" id="{$child.id}" name="ord" class="node_sort form-control pull-left" value="{$child.ord}">
                        <label level='2'>
                            {$child.title}
                            <span class='auth_color'>[{$child.name}]</span>
                        </label>
                        <span class="label label-danger pull-right" id='{$child.id}'>删除</span>
                            </h3>
                            </div>
                            <div class="panel-body">
                                <!--leve3-->
                                <foreach name='child.child' item='child3'>
                                    <div class="panel panel-info level-3">
                                        <div class="panel-heading">
                                            <h3 class="panel-title panelh3">
                                        <input type="text" id="{$child3.id}" name="ord" class="node_sort form-control pull-left" value="{$child3.ord}">
                                    <label level='3' style='margin-bottom:0px'>
                                         {$child3.title}
                                        <span class='auth_color'>[{$child3.name}]</span>
                                    </label>
                                    <span class="label label-danger pull-right" id='{$child3.id}'>删除</span>
                                        </h3>
                                        </div>
                                        <div class="panel-body">
                                            <volist name="child3.child" id="vo">
                                                <label class='child_model'>
                                                    <input type="text" id="{$vo.id}" name="ord" class="node_sort form-control pull-left" value="{$vo.ord}"> {$vo.title}<span class="label label-danger pull-right" id='{$vo.id}'>删除</span>
                                                </label>
                                            </volist>
                                        </div>
                                    </div>
                                </foreach>
                                <!--leve3-->
                            </div>
                        </div>
                    </foreach>
                    <!--end leve2-->
                </div>
            </div>
        </foreach>
        <!--//权限结构-->
    </div>
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增权限节点</h4>
                </div>
                <div class="modal-body">
                    <form class="require" action="{:U('node')}" method="post">
                        <div class="form-group">
                            <label for="exampleInputEmail1">节点<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder='示例:Admin/Index/index' name='name' datatype='*'>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">规则名称<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" name='title' placeholder="规则名称" datatype='*'>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">配置分类<span class="Validform_checktip"></span></label>
                            <select class="form-control selectpicker" name='level' datatype='*' data-live-search="true">
                                <option value='0'>--根节点--</option>
                                <foreach name='list.role' item='role'>
                                <option value='{$role.id}'>
                                 └─{$role.title}
                                    </option>
                                    <foreach name='role.child' item='child'>
                                        <option value='{$child.id}'>└────── {$child.title}--
                                        </option>
                                        <foreach name='child.child' item='child3'>
                                            <option value='{$child3.id}'>└─────────── {$child3.title}--
                                            </option>
                                            <volist name='child3.child' id='child4'>
                                                <option value='Limit'>└─────────────────── {$child4.title}--
                                                </option>
                                            </volist>
                                        </foreach>
                                    </foreach>
                                </foreach>
                            </select>
                        </div>
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-primary btn-block" type="submit">保存配置</button>
                        </div>
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-default btn-block" type="button" data-dismiss="modal">关闭</button>
                        </div>
                        <br/>
                        <br/>
                        <br/>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--end Modal-->
</block>
<block name='javascript'>
    <script type="text/javascript">
    var NodeSort = "{:U('NodeSort')}";
    var AccessDelUrl="{:U('del_user_role')}";
    </script>
</block>
